home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 117 / PC Guia 117.iso / Software / Utils / Software6 / Product8 / feedview-0.9.7-fx.xpi / chrome / feedview.jar / content / rss.xml < prev    next >
Extensible Markup Language  |  2005-03-19  |  9KB  |  207 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.      xmlns="http://www.w3.org/1999/xhtml"
  4.      xmlns:date="http://www.jclark.com/xt/java/java.util.Date"
  5.      xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0"
  6.      xmlns:atom="http://purl.org/atom/ns#"
  7.      xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  8.     <xsl:param name="feedUrl"/>
  9.     <xsl:param name="feedDescription"/>
  10.     <xsl:param name="feedTitle"/>
  11.     <xsl:param name="article_length"/>
  12.     <xsl:param name="articleSize"/>
  13.     <xsl:param name="showDate"/>
  14.     <xsl:param name="showBar"/>
  15.     <xsl:param name="showImage"/>
  16.     <xsl:param name="showImage"/>
  17.     <xsl:param name="timerInterval"/>
  18.     <xsl:param name="externalCSS"/>
  19.     <xsl:output method="html" media-type="text/html"/>
  20.     <xsl:template match="/">
  21.         <html>
  22.             <head>
  23.                 <link rel="alternate" type="application/rss+xml" title="Current Feed" href=""/>
  24.                 <title>
  25.                     <xsl:value-of select="$feedTitle"/>
  26.                 </title>
  27.                 <link rel="stylesheet" href="chrome://feedview/content/default.css"/>
  28.                 <link rel="stylesheet">
  29.                     <xsl:attribute name="href">
  30.                         <xsl:value-of select="$externalCSS"/>
  31.                     </xsl:attribute>
  32.                 </link>
  33.                 <script src="chrome://feedview/content/feedview.js"></script>
  34.             </head>
  35.             <body>
  36.                 <!-- Menu box -->
  37.                 <div id="menubox">
  38.                     <xsl:value-of select="$article_length"/>
  39.                     <br/>
  40.                     <table>
  41.                         <tr id="sizeSwitcher">
  42.                             <td>
  43.                                 <a onclick="javascript:resize(100);">
  44.                                     <div style="height: 10px;"/>
  45.                                 </a>
  46.                             </td>
  47.                             <td>
  48.                                 <a onclick="javascript:resize(300);">
  49.                                     <div style="margin-left: 8px; margin-right: 8px; height: 15px; "/>
  50.                                 </a>
  51.                             </td>
  52.                             <td>
  53.                                 <a onclick="javascript:resize(900);">
  54.                                     <div style="height: 20px; "/>
  55.                                 </a>
  56.                             </td>
  57.                         </tr>
  58.                     </table>
  59.                     <xul:slider id="sizeslider"  style="width:110px; " flex="1" pageincrement="10" maxpos="100" onmousemove="resize(this.getAttribute('curpos'))" onclick="resize(this.getAttribute('curpos'))" onmouseup="resize(this.getAttribute('curpos'))">
  60.                         <xsl:attribute name="curpos">
  61.                             <xsl:value-of select="$articleSize"/>
  62.                         </xsl:attribute>
  63.                         <xul:thumb/>
  64.                     </xul:slider>
  65.                     <br/>
  66.                     <br/>
  67.                     <span id="number">
  68.                         <xsl:value-of select="$feedDescription"/>
  69.                     </span>
  70.                     <br/>
  71.                     <br/>
  72.                     <a id="switchdate" onclick="javascript:if(this.getAttribute('show')==0)this.setAttribute('show',1);else this.setAttribute('show',0); switchdate();" >
  73.                         <xsl:attribute name="show">
  74.                             <xsl:value-of select="$showDate"/>
  75.                         </xsl:attribute>
  76.                     </a>
  77.                     <br/>
  78.                     <br/>
  79.                     <span id="timerspan">Refresh in <span id="timevalue">
  80.                             <xsl:value-of select="$timerInterval"/>
  81.                         </span> seconds</span>
  82.                 </div>
  83.                 <options id="options" style="display:none">
  84.                     <xsl:attribute name="showbar">
  85.                         <xsl:value-of select="$showBar"/>
  86.                     </xsl:attribute>
  87.                     <xsl:attribute name="showimage">
  88.                         <xsl:value-of select="$showImage"/>
  89.                     </xsl:attribute>
  90.                     <xsl:attribute name="timerinterval">
  91.                         <xsl:value-of select="$timerInterval"/>
  92.                     </xsl:attribute>
  93.                 </options>
  94.                 <xsl:apply-templates/>
  95.                 <!-- Dynamic stuff -->
  96.                 <script><![CDATA[
  97.  
  98.                     if(document.getElementById("options").getAttribute("showbar") != "true")
  99.                             document.getElementById("menubox").style.display = "none";
  100.  
  101.                     if(document.getElementById("options").getAttribute("showimage") != "true")
  102.                         showImage = false; else showImage = true;
  103.  
  104.                     setDate(); resize(document.getElementById("sizeslider").getAttribute("curpos"), showImage); setFeed(); switchdate();
  105.                      var interval = document.getElementById("options").getAttribute("timerinterval");
  106.                     
  107.  
  108.                     function refresh(){ 
  109.                         interval -= 1; 
  110.                         if(interval <= 0) 
  111.                             window.location.href = window.location.href;
  112.                         else
  113.                             document.getElementById("timevalue").textContent = interval;
  114.                         setTimeout("refresh()",1000); 
  115.                     }
  116.  
  117.  
  118.                     if(interval > 0)
  119.                         setTimeout("refresh()",1000); 
  120.                     else
  121.                         document.getElementById("timerspan").style.display = "none";
  122.  
  123.              
  124.                 ]]>
  125.                 </script>
  126.             </body>
  127.         </html>
  128.     </xsl:template>
  129.     <!-- RSS RDF Support-->
  130.     <xsl:template name="a-element">
  131.         <xsl:element name="a">
  132.             <xsl:attribute name="href">
  133.                 <xsl:apply-templates select="*[local-name()='link']"/>
  134.             </xsl:attribute>
  135.             <xsl:value-of select="*[local-name()='title']"/>
  136.         </xsl:element>
  137.     </xsl:template>
  138.     <xsl:template match="*[local-name()='channel']">
  139.         <h1>
  140.             <xsl:call-template name="a-element"/>
  141.         </h1>
  142.         <!-- Following line for RSS .091 -->
  143.         <div id="articles">
  144.             <xsl:apply-templates select="*[local-name()='item']"/>
  145.         </div>
  146.     </xsl:template>
  147.     <xsl:template match="*[local-name()='image']"></xsl:template>
  148.     <xsl:template match="*[local-name()='textinput']"></xsl:template>
  149.     <xsl:template match="*[local-name()='item']">
  150.         <div class="post">
  151.             <xsl:attribute name="description">
  152.                 <xsl:value-of select="*[local-name()='description']" />
  153.             </xsl:attribute>
  154.             <xsl:if test="dc:date">
  155.                 <xsl:attribute name="date">
  156.                     <xsl:value-of select="dc:date" />
  157.                 </xsl:attribute>
  158.             </xsl:if>
  159.             <xsl:if test="*[local-name()='pubDate']">
  160.                 <xsl:attribute name="date">
  161.                     <xsl:value-of select="*[local-name()='pubDate']" />
  162.                 </xsl:attribute>
  163.             </xsl:if>
  164.             <xsl:call-template name="a-element"/>
  165.             <span class="date"></span>
  166.  
  167.             <p></p>
  168.  
  169.         </div>
  170.     </xsl:template>
  171.     <!-- ATOM SUPPORT-->
  172.     <xsl:template match="atom:feed">
  173.         <h1>
  174.             <a href="{atom:link[substring(@rel, 1, 8)!='service.']/@href}">
  175.                 <xsl:value-of select="atom:title"/>
  176.             </a>
  177.         </h1>
  178.         <div id="articles">
  179.             <xsl:apply-templates select="atom:entry"/>
  180.         </div>
  181.     </xsl:template>
  182.     <xsl:template match="atom:entry">
  183.         <div class="post">
  184.             <xsl:if test="atom:issued">
  185.                 <xsl:attribute name="date">
  186.                     <xsl:value-of select="atom:issued"/>
  187.                 </xsl:attribute>
  188.             </xsl:if>
  189.             <xsl:attribute name="description">
  190.                 <xsl:choose>
  191.                     <xsl:when test="atom:content">
  192.                         <xsl:value-of select="atom:content"/>
  193.                     </xsl:when>
  194.                     <xsl:otherwise>
  195.                         <xsl:value-of select="atom:summary"/>
  196.                     </xsl:otherwise>
  197.                 </xsl:choose>
  198.             </xsl:attribute>
  199.             <a href="{atom:link[substring(@rel, 1, 8)!='service.']/@href}">
  200.                 <xsl:value-of select="atom:title"/>
  201.             </a>
  202.             <span class="date"/>
  203.             <p/>
  204.         </div>
  205.     </xsl:template>
  206. </xsl:stylesheet>
  207.